import { Form, Input, Select, Switch } from 'antd';


interface Props {
    form: any;
    setForm: any; 
}
const BrandForm = ({ form, setForm }: Props) => {
    console.log(form)
    return (
        <div>
            <Form
                name="basic"
                autoComplete="off"


            >
                <Form.Item label=" 店铺名称" className='m-l-2.5'>
                    <span >{form.shopname}</span>
                </Form.Item>
                <Form.Item label=" 打印机名称" className='m-l-2.5'>
                    <Input
                        placeholder="请输入打印机名称"
                        value={form.printername}
                        onChange={(e) => {
                            setForm({ ...form, printername: e.target.value })

                        }} />
                </Form.Item>
                <Form.Item label=" 选择打印机类型" className='m-l-2.5'>
                    <Select
                        defaultValue={form.printertype}
                        value={form.printertype}
                        options={[
                            { value: '', label: '请选择' },
                            { value: 'XP-PC56（XXXX网络打印设备）', label: 'XP-PC56（XXXX网络打印设备）' },
                            { value: 'XP-PC90（XXXX网络打印设备）', label: 'XP-PC90（XXXX网络打印设备）' },
                        ]}
                        onChange={(e)=>{
                            setForm({ ...form, printertype:e })
                        }}
                    />
                </Form.Item>
                <Form.Item label=" 打印机IP地址" className='m-l-2.5'>
                    <Input
                        placeholder="请输入打印机IP地址"
                        value={form.printerIP}
                        onChange={(e) => {
                            setForm({ ...form, printerIP: e.target.value })

                        }} />
                </Form.Item>
                <Form.Item label=" 设备终端号" className='m-l-2.5'>
                    <Input
                        placeholder="请输入设备终端号"
                        value={form.terminal}
                        onChange={(e) => {
                            setForm({ ...form, terminal: e.target.value })

                        }} />
                </Form.Item>
                <Form.Item label=" 设备终端密钥" className='m-l-2.5'>
                    <Input
                    placeholder="请输入设备终端密钥"
                        value={form.terminalkey}
                        onChange={(e) => {
                            setForm({ ...form, terminalkey: e.target.value })

                        }} />
                </Form.Item>
                <Form.Item label=" 选择打印模板" className='m-l-2.5'>
                    <Select
                        defaultValue="请选择"
                        value={form.printertemplate}
                        onChange={(e)=>{
                            setForm({ ...form, printertemplate: e})
                        }}
                        options={[
                            { value: '', label: '请选择' },
                            { value: ' XP-PC91（XXXX网络打印设备）', label: '  XP-PC91（XXXX网络打印设备）' },
                            { value: '  XP-PC10（XXXX网络打印设备）', label: '  XP-PC10（XXXX网络打印设备）' },
                        ]}
                    />
                </Form.Item>
                <Form.Item label=" 设置打印尺寸" className='m-l-2.5'>
                    <Input
                        placeholder="设置打印尺寸"
                        value={form.printsize}
                        onChange={(e) => {
                            setForm({ ...form, printsize: e.target.value })

                        }} />
                </Form.Item>
                <Form.Item label=" 打印张数" className='m-l-2.5'>
                    <Input
                        placeholder="打印张数"
                        value={form.printmuch}
                        onChange={(e) => {
                            setForm({ ...form, printmuch: e.target.value })

                        }} />
                </Form.Item>
                <Form.Item label=" 小票备注" className='m-l-2.5'>
                    <Input
                        type='textarea'
                        value={form.notes}
                        onChange={(e) => {
                            setForm({ ...form, notes: e.target.value })

                        }} />
                </Form.Item>
                <Form.Item label=" 自动打印设置" className='m-l-2.5'>
                    <Switch defaultChecked={form.autoprint} onChange={ () => {
                     
                        setForm({ ...form, autoprint: !form.autoprint })

                    }} />
                </Form.Item>

            </Form>
        </div>
    );
};

export default BrandForm;